const express = require('express');
const router = express.Router();

router.get('/', (req, res) => {
    const content = [];
    for(let i = 1; i <= 20; i++) content.push({
        id: `${i}`,
        code: 'string',
        dealerCode: 'string',
        dealerName: 'string',
        boardPort: 'string',
        boardDate: '2020-03-18T06:33:27.206Z',
        destinationPort: 'string',
        carrierName: 'string',
        planArriveTime: '2020-03-18T06:33:27.206Z',
        partShipmentStatus: 0,
        rowVersion: 'string',
        createTime: '2020-03-18T06:33:27.206Z',
        options: [
            'update', 'abandon'
        ]
    });
    res.json(
        {
            message: '',
            payload: {
                content,
                totalElements: 100,
            }
        }
    );
});

router.get('/:id', (req, res) => {
    res.json({
        payload: {
            id: '1',
            code: 'string',
            dealerCode: 'string',
            dealerName: 'string',
            boardPort: 'string',
            boardDate: '2020-03-18T06:33:27.206Z',
            destinationPort: 'string',
            carrierName: 'string',
            planArriveTime: '2020-03-18T06:33:27.206Z',
            partShipmentStatus: 0,
            rowVersion: 'string',
            createTime: '2020-03-18T06:33:27.206Z',
            options: [
                'update', 'abandon'
            ],
            dealerId: 'string',
            brandId: 'string',
            brandName: 'string',
            brandCode: 'string',
            country: 'string',
            documentationClerkNo: 'string',
            transportStatus: 0,
            remark: 'string',
            creatorName: 'string',
            abandonerName: 'string',
            abandonTime: '2020-03-18T06:34:32.875Z',
            details: [
                {
                    id: '1',
                    serialNums: 'string',
                    saleShipmentCode: 'string',
                    VIN: 'string'
                }, {
                    id: '2',
                    serialNums: 'string',
                    saleShipmentCode: 'string',
                    VIN: 'string'
                }, {
                    id: '3',
                    serialNums: 'string',
                    saleShipmentCode: 'string',
                    VIN: 'string'
                }
            ]
        }
    });
});
router.put('/:id', (req, res) => {
    res.json({
        message: 'success'
    });
});
router.put('/:id/abandon', (req, res) => {
    res.json({
        message: 'success'
    });
});
router.post('/import', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
module.exports = router;
